
public class Stack {
	int top;
	int maxSize;
	char[] arrayStack;
	public  Stack(int maxSize){
		this.maxSize = maxSize;
		arrayStack = new char[maxSize];
		top=-1;
	}
	public void push(char element){
		arrayStack[++top] = element;
	}
	public char pop(){
		if(top==-1)
			throw new ArrayIndexOutOfBoundsException("error");
		return arrayStack[top--];
	}
	public char peek(){
		return arrayStack[top];
	}
	public boolean isEmpty(){
		return (top==-1);
	}
	public boolean isFull(){
		return(top == maxSize-1);
	}
}
